package com.wcl.demo.utils;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

/**
 * Created by dllo on 15/11/18.
 */
public class ActivityUtils extends Activity {
    // 跳转
    public static void startToActivity(Context from, Class to) {
        Intent intent = new Intent(from, to);

        from.startActivity(intent);
    }

    // 传值和跳转
    public static void startToActivity(Context from, Class to, Bundle bundle) {
        Intent intent = new Intent(from, to);
        intent.putExtras(bundle);
        from.startActivity(intent);
    }

    // 接收跳转后的传值
    public static Bundle fromSrc(Context context) {
        Intent intent = ((Activity) context).getIntent();
        return intent.getExtras();
    }
}
